home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / Xt / XtAppNextEvent.z / XtAppNextEvent
Encoding:
Text File  |  1998-10-30  |  8.9 KB  |  199 lines

  1.  
  2.  
  3.  
  4.      XXXXttttAAAAppppppppNNNNeeeexxxxttttEEEEvvvveeeennnntttt((((3333XXXXtttt))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXttttAAAAppppppppNNNNeeeexxxxttttEEEEvvvveeeennnntttt((((3333XXXXtttt))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XtAppNextEvent, XtAppPending, XtAppPeekEvent,
  10.           XtAppProcessEvent, XtDispatchEvent, XtAppMainLoop - query
  11.           and process events and input
  12.  
  13.      SSSSYYYYNNNNTTTTAAAAXXXX
  14.           void XtAppNextEvent(_a_p_p__c_o_n_t_e_x_t, _e_v_e_n_t__r_e_t_u_r_n)
  15.                 XtAppContext _a_p_p__c_o_n_t_e_x_t;
  16.                 XEvent *_e_v_e_n_t__r_e_t_u_r_n;
  17.  
  18.           Boolean XtAppPeekEvent(_a_p_p__c_o_n_t_e_x_t, _e_v_e_n_t__r_e_t_u_r_n)
  19.                 XtAppContext _a_p_p__c_o_n_t_e_x_t;
  20.                 XEvent *_e_v_e_n_t__r_e_t_u_r_n;
  21.  
  22.           XtInputMask XtAppPending(_a_p_p__c_o_n_t_e_x_t)
  23.                 XtAppContext _a_p_p__c_o_n_t_e_x_t;
  24.  
  25.           void XtAppProcessEvent(_a_p_p__c_o_n_t_e_x_t, _m_a_s_k)
  26.                 XtAppContext _a_p_p__c_o_n_t_e_x_t;
  27.                 XtInputMask _m_a_s_k;
  28.  
  29.           Boolean XtDispatchEvent(_e_v_e_n_t)
  30.                 XEvent *_e_v_e_n_t;
  31.  
  32.           void XtAppMainLoop(_a_p_p__c_o_n_t_e_x_t)
  33.                 XtAppContext _a_p_p__c_o_n_t_e_x_t;
  34.  
  35.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  36.           _a_p_p__c_o_n_t_e_x_t
  37.                     Specifies the application context that identifies
  38.                     the application .
  39.  
  40.           _e_v_e_n_t     Specifies a pointer to the event structure that is
  41.                     to be dispatched to the appropriate event handler.
  42.  
  43.           _e_v_e_n_t__r_e_t_u_r_n
  44.                     Returns the event information to the specified
  45.                     event structure.
  46.  
  47.           _m_a_s_k      Specifies what types of events to process.  The
  48.                     mask is the bitwise inclusive OR of any
  49.                     combination of _X_t_I_M_X_E_v_e_n_t, _X_t_I_M_T_i_m_e_r,
  50.                     _X_t_I_M_A_l_t_e_r_n_a_t_e_I_n_p_u_t, and _X_t_I_M_S_i_g_n_a_l.  As a
  51.                     convenience, the X Toolkit defines the symbolic
  52.                     name _X_t_I_M_A_l_l to be the bitwise inclusive OR of all
  53.                     event types.
  54.  
  55.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  56.           If the X event queue is empty, _X_t_A_p_p_N_e_x_t_E_v_e_n_t flushes the X
  57.           output buffers of each Display in the application context
  58.           and waits for an event while looking at the other input
  59.           sources, timeout timeout values, and signal handlers and
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 4/30/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXttttAAAAppppppppNNNNeeeexxxxttttEEEEvvvveeeennnntttt((((3333XXXXtttt))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXttttAAAAppppppppNNNNeeeexxxxttttEEEEvvvveeeennnntttt((((3333XXXXtttt))))
  71.  
  72.  
  73.  
  74.           calling any callback procedures triggered by them.  This
  75.           wait time can be used for background processing (see Section
  76.           7.8).
  77.  
  78.           If there is an event in the queue, _X_t_A_p_p_P_e_e_k_E_v_e_n_t fills in
  79.           the event and returns a nonzero value. If no X input is on
  80.           the queue, _X_t_A_p_p_P_e_e_k_E_v_e_n_t flushes the output buffer and
  81.           blocks until input is available (possibly calling some
  82.           timeout callbacks in the process).  If the input is an
  83.           event, _X_t_A_p_p_P_e_e_k_E_v_e_n_t fills in the event and returns a
  84.           nonzero value.  Otherwise, the input is for an alternate
  85.           input source, and _X_t_A_p_p_P_e_e_k_E_v_e_n_t returns zero.
  86.  
  87.           The _X_t_A_p_p_P_e_n_d_i_n_g function returns a nonzero value if there
  88.           are events pending from the X server, timer pending, or
  89.           other input sources pending. The value returned is a bit
  90.           mask that is the OR of _X_t_I_M_X_E_v_e_n_t, _X_t_I_M_T_i_m_e_r,
  91.           _X_t_I_M_A_l_t_e_r_n_a_t_e_I_n_p_u_t, and _X_t_I_M_S_i_g_n_a_l (see _X_t_A_p_p_P_r_o_c_e_s_s_E_v_e_n_t).
  92.           If there are no events pending, _X_t_A_p_p_P_e_n_d_i_n_g flushes the
  93.           output buffer and returns zero.
  94.  
  95.           The _X_t_A_p_p_P_r_o_c_e_s_s_E_v_e_n_t function processes one timer,
  96.           alternate input, signal source, or X event.  If there is
  97.           nothing of the appropriate type to process,
  98.           _X_t_A_p_p_P_r_o_c_e_s_s_E_v_e_n_t blocks until there is.  If there is more
  99.           than one type of thing available to process, it is undefined
  100.           which will get processed.  Usually, this procedure is not
  101.           called by client applications (see _X_t_A_p_p_M_a_i_n_L_o_o_p).
  102.           _X_t_A_p_p_P_r_o_c_e_s_s_E_v_e_n_t processes timer events by calling any
  103.           appropriate timer callbacks, alternate input by calling any
  104.           appropriate alternate input callbacks, signal source by
  105.           calling any appropriate signal callbacks, and X events by
  106.           calling _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t.
  107.  
  108.           When an X event is received, it is passed to
  109.           _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t, which calls the appropriate event handlers
  110.           and passes them the widget, the event, and client-specific
  111.           data registered with each procedure.  If there are no
  112.           handlers for that event registered, the event is ignored and
  113.           the dispatcher simply returns.  The order in which the
  114.           handlers are called is undefined.
  115.  
  116.           The _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t function sends those events to the event
  117.           handler functions that have been previously registered with
  118.           the dispatch routine.  _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t returns _T_r_u_e if it
  119.           dispatched the event to some handler and _F_a_l_s_e if it found
  120.           no handler to dispatch the event to.  The most common use of
  121.           _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t is to dispatch events acquired with the
  122.           _X_t_A_p_p_N_e_x_t_E_v_e_n_t procedure.  However, it also can be used to
  123.           dispatch user-constructed events.  _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t also is
  124.           responsible for implementing the grab semantics for
  125.           _X_t_A_d_d_G_r_a_b.
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 4/30/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXttttAAAAppppppppNNNNeeeexxxxttttEEEEvvvveeeennnntttt((((3333XXXXtttt))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXttttAAAAppppppppNNNNeeeexxxxttttEEEEvvvveeeennnntttt((((3333XXXXtttt))))
  137.  
  138.  
  139.  
  140.           The _X_t_A_p_p_M_a_i_n_L_o_o_p function first reads the next incoming X
  141.           event by calling _X_t_A_p_p_N_e_x_t_E_v_e_n_t and then it dispatches the
  142.           event to the appropriate registered procedure by calling
  143.           _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t.  This constitutes the main loop of X
  144.           Toolkit applications, and, as such, it does not return.
  145.           Applications are expected to exit in response to some user
  146.           action.  There is nothing special about _X_t_A_p_p_M_a_i_n_L_o_o_p; it is
  147.           simply an infinite loop that calls _X_t_A_p_p_N_e_x_t_E_v_e_n_t and then
  148.           _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t.
  149.  
  150.           Applications can provide their own version of this loop,
  151.           which tests some global termination flag or tests that the
  152.           number of top-level widgets is larger than zero before
  153.           circling back to the call to _X_t_A_p_p_N_e_x_t_E_v_e_n_t.
  154.  
  155.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  156.           _X _T_o_o_l_k_i_t _I_n_t_r_i_n_s_i_c_s - _C _L_a_n_g_u_a_g_e _I_n_t_e_r_f_a_c_e
  157.           _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 4/30/98)
  196.  
  197.  
  198.  
  199.